package com.nineclock.system.controller;

import com.nineclock.api.system.SysDepartmentControllerApi;
import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysDepartmentDTO;
import com.nineclock.system.service.SysDepartmentService;
import org.apache.ibatis.annotations.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@RestController
@RequestMapping("/department")
public class SysDepartmentController implements SysDepartmentControllerApi {

    @Autowired
    SysDepartmentService departmentService;

    @Override
    @GetMapping("/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable Long companyUserId) {
        List<Long> ids = departmentService.queryDepartmentsByUserId(companyUserId);
        return Result.success(ids);
    }
}
